package qimao.com.edu.entity;

import jakarta.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 用户表
 * @author 86173
 *
 */
//@Entity
//@Table(name = "users")
public class Users {
	/**
	 * 用户id
	 */
//    @Id
//    @Column(name = "user_id", nullable = false)
    private Integer userId;
    /**
	 * 账号名
	 */
//    @Column(name = "username", nullable = false, length = 50, unique = true)
    private String username;
    /**
	 * 密码
	 */
//    @Column(name = "password", nullable = false, length = 100)
    private String password;
    /**
	 * 角色
	 */
//    @Column(name = "roleName",nullable = false,columnDefinition = "VARCHAR(100) DEFAULT 'author'")
    private String roleName;
    /**
	 * 网名
	 */
//    @Column(name = "nickname", nullable = false, length = 50)
    private String nickname;
    /**
	 * 头像
	 */
//    @Column(name = "avatar", length = 255)
    private String avatar;
    /**
	 * 生日
	 */
//    @Column(name = "birthday")
    private LocalDate birthday;
    /**
	 * 注册时间
	 */
//    @Column(name = "register_time", nullable = false)
    private LocalDateTime registerTime;
    
    /**
	 * 账号状态 0-禁用，1-正常
	 */
    
//    @Column(name = "status", nullable = false, columnDefinition = "TINYINT DEFAULT 1")
    private Integer status; // 0-禁用，1-正常

	public Users() {
		super();
	}

	public Users(Integer userId, String username, String password, String roleName, String nickname, String avatar,
			LocalDate birthday, LocalDateTime registerTime, Integer status) {
		super();
		this.userId = userId;
		this.username = username;
		this.password = password;
		this.roleName = roleName;
		this.nickname = nickname;
		this.avatar = avatar;
		this.birthday = birthday;
		this.registerTime = registerTime;
		this.status = status;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public LocalDate getBirthday() {
		return birthday;
	}

	public void setBirthday(LocalDate birthday) {
		this.birthday = birthday;
	}

	public LocalDateTime getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(LocalDateTime registerTime) {
		this.registerTime = registerTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "Users [userId=" + userId + ", username=" + username + ", password=" + password + ", roleName="
				+ roleName + ", nickname=" + nickname + ", avatar=" + avatar + ", birthday=" + birthday
				+ ", registerTime=" + registerTime + ", status=" + status + "]";
	}

}
